home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / isnumeric.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  822 b   |  45 lines

  1. <!--- This example shows the use of IsNumeric --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. IsNumeric Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12. <BODY  bgcolor="#FFFFD5">
  13.  
  14. <H3>IsNumeric Example</H3>
  15.  
  16. <CFIF IsDefined("form.theTestValue")>
  17.  
  18.     <CFIF IsNumeric(form.theTestValue)>
  19.     <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> can be converted to a number</H3>
  20.     <CFELSE>
  21.     <H3>The string <CFOUTPUT>#DE(form.theTestValue)#</CFOUTPUT> cannot be converted to a number</H3>
  22.  
  23.     </CFIF>
  24.  
  25.  
  26. </CFIF>
  27.  
  28. <FORM ACTION="isnumeric.cfm" METHOD="POST">
  29. <P>Enter a string, and discover if
  30. it can be evaluated to a numeric value.
  31.  
  32. <P><INPUT TYPE="Text" NAME="TheTestValue" VALUE="123">
  33.  
  34. <INPUT TYPE="Submit" VALUE="Is it a Number?" NAME="">
  35.  
  36.  
  37. </FORM>
  38.  
  39.  
  40.  
  41. </BODY>
  42.  
  43. </HTML>       
  44.   
  45.